package cn.tedu.calendar;

import java.util.Calendar;

public class CalendarDemo {
    public static void main(String[] args) {
        Calendar calendar = Calendar.getInstance();
        System.out.println(calendar);
//        calendar.add(Calendar.DAY_OF_MONTH,-4);
        calendar.add(Calendar.MONTH,2);//2个月后
        System.out.println(calendar);
        int year = calendar.get(Calendar.YEAR);
        int month = calendar.get(Calendar.MONTH)+1;
        int day = calendar.get(Calendar.DAY_OF_MONTH);
        System.out.println(year+"-"+month+"-"+day);
        //2003年02月01日
        //String Date或者Calendar
    }
}
